<nav>
  <%= tabs_tag(:namespace => :sub_nav, :open_tabs => {}, :builder => MenuTabBuilder) do |tab| %>
    <%= tab.areas '<i class="fa fa-lg fa-fw fa-map-marker"></i> 
        <span class="menu-item-parent">
           区域管理
        </span>'.html_safe, admin_areas_path %>
    <li>
      <a herf="<%=admin_account_groups_path%>">
        <i class="fa fa-lg fa-fw fa-sitemap"></i> 
        <span class="menu-item-parent">
          设备管理
        </span>
      </a>
      <ul>
        <%= tab.terminal_groups '<i class="fa fa-lg fa-fw fa-gears"></i> 
            <span class="menu-item-parent">
               行业列表
            </span>'.html_safe, admin_terminal_groups_path %>
        <% Province.includes(:cities).all.each do |province| %>
          <% if current_admin.can_see?(province) %>
          <li>
            <a herf="#">
              <span class="menu-item-parent">
                <%= province.name %> 
              </span>
            </a>
            <% if !province.cities.blank? && province.cities.any?{|city| current_admin.can_see?(city) } %>
              <ul>
              <% province.cities.each do |city| %>
                <% if current_admin.can_see?(city) %>
                  <%= eval %{ tab.city_#{city.id} city.name, admin_terminal_groups_path(city_id: city.id)} %>
                <% end %>
              <% end %>
              </ul>
            <% end %>
          </li>
          <% end %>
        <% end %>
      </ul>
    </li>
  <% end %>
</nav>